var e = getApp();

Page({
    data: {
        backgroundUrl: "",
        checked: !0,
        isDisagree: !1,
        showAgreement: !1,
        protocol_content: ""
    },
    onLoad: function(e) {
        this.init(), this.getBackground(), this.getAgreement();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    init: function() {
        this.setData({
            checked: !0,
            backgroundUrl: "",
            isDisagree: !1,
            showAgreement: !1,
            protocol_content: ""
        });
    },
    getBackground: function() {
        var t = this, o = e.getNetAddresss("plugin.video-share.frontend.set.getBackground");
        e._getNetWork({
            url: o,
            data: {
                validate_page: 1
            },
            success: function(e) {
                var o = e.data;
                1 == o.result ? t.setData({
                    backgroundUrl: o.data.background
                }) : wx.showToast({
                    title: o.msg,
                    icon: "none",
                    duration: 1500
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    getAgreement: function() {
        var t = this, o = e.getNetAddresss("plugin.video-share.frontend.set.getAgreement");
        e._getNetWork({
            url: o,
            data: {},
            success: function(e) {
                var o = e.data;
                1 == o.result ? t.setData({
                    protocol_content: o.data.agreement
                }) : t.setData({
                    protocol_content: o.msg
                });
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    gotoRelease: function() {
        var e = this;
        if (this.data.checked) {
            try {
                wx.removeStorageSync("shareVideoPath");
            } catch (e) {}
            wx.navigateTo({
                url: "/packageC/video_goods/releaseVideo/releaseVideo"
            });
        } else wx.showToast({
            icon: "none",
            title: "请先勾选阅读并同意《用户协议》",
            duration: 1500
        }), this.setData({
            isDisagree: !1
        }), setTimeout(function() {
            e.setData({
                isDisagree: !0
            });
        }, 0);
    },
    agreementbtn: function(e) {
        var t = e.detail;
        this.setData({
            checked: t
        });
    },
    gotoAgreement: function() {
        this.setData({
            showAgreement: !0
        });
    },
    popClose: function() {
        this.setData({
            showAgreement: !1
        });
    }
});